Skip to content

fix(ingest/powerbi): derive page and tile chart inputs from report fields - #20885

Open
brock-acryl wants to merge 7 commits into
feat/powerbi-warehouse-endpoint-lineagefrom
feat/powerbi-chart-inputs-from-fields
Open

brock-acryl wants to merge 7 commits into
feat/powerbi-warehouse-endpoint-lineagefrom
feat/powerbi-chart-inputs-from-fields

Conversation

@brock-acryl

@brock-acryl brock-acryl commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • With extract_report_field_usage, a page chart lists as inputs only the model tables its fields read, and a tile pinned from a report lists the tables that report's pages read, instead of every table of the model. A table counts when a reference names it even if the field is missing from the schema; a page or tile whose references match no table keeps the whole model and is reported (report_pages_inputs_fallback).
  • Narrowing applies only to tables this run emitted (no edges to datasets filtered out by filter_dataset_endorsements).
  • Independently of the flag: page charts link to their page in Power BI, and untitled tiles are named Tile <n> by their order in the dashboard's tile list (title only; URNs unchanged).
  • Unresolved field references are split into table-unknown and field-unknown counters for pages and visuals.

Stack

Part of a stack built on #20842 (Power BI metadata_api_mode: workspace_apis). Merge order:
#20876 → #20877 → #20878 → #20879 → #20880 → #20881 → #20882 → #20883 → #20884 → #20885.
Review this PR's own diff against its base branch; each layer is self-contained and tested on its own.

Checklist

  • PR title follows the Conventional Commits format
  • Tests added/updated (unit and integration goldens)
  • Docs updated (metadata-ingestion/docs/sources/powerbi/)
  • No breaking change

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@brock-acryl
brock-acryl force-pushed the feat/powerbi-chart-inputs-from-fields branch from be34f71 to f603f2c Compare December 2, 2026 18:52
@brock-acryl
brock-acryl force-pushed the feat/powerbi-chart-inputs-from-fields branch from f603f2c to 2caaea9 Compare December 2, 2026 19:20
@brock-acryl
brock-acryl force-pushed the feat/powerbi-chart-inputs-from-fields branch from 2caaea9 to 5c2a2a8 Compare December 2, 2026 19:30
@brock-acryl
brock-acryl force-pushed the feat/powerbi-chart-inputs-from-fields branch from 5c2a2a8 to ffb32ad Compare December 2, 2026 20:36
@brock-acryl
brock-acryl force-pushed the feat/powerbi-chart-inputs-from-fields branch 2 times, most recently from e296c91 to c5d0b47 Compare December 2, 2026 20:51
@brock-acryl
brock-acryl force-pushed the feat/powerbi-chart-inputs-from-fields branch from c5d0b47 to 6b2f522 Compare December 2, 2026 21:01
@brock-acryl
brock-acryl force-pushed the feat/powerbi-chart-inputs-from-fields branch from 6b2f522 to 221e3ab Compare December 3, 2026 11:14
@cursor

cursor Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
Refines chart lineage and metadata for Power BI dashboards and reports. With extract_report_field_usage, page charts and report-backed tiles no longer list every semantic-model table as inputs—they keep only tables their resolved field references name (including when the field is missing from the schema but the table exists). Tiles reuse the union of tables their source report’s pages read, intersected with tables emitted in the run. Parsing must be complete (field_usage_complete); otherwise inputs stay on the full model without false narrowing. Unresolvable references that name no model table trigger a whole-model fallback plus a Page Inputs Fell Back To Whole Model warning and new report_*_field_unresolved counters alongside existing table-unknown counts.

Always-on improvements (any metadata_api_mode): report page charts get a chartUrl to the page in the Power BI service; dashboard tiles without a title are named Tile <n> by 1-based position in the tile list (URNs unchanged; reordering tiles can rename untitled tiles).

Docs and docs/how/breaking-changes.md call out removed chart-to-table edges and title changes for integrators who matched on empty tile names or assumed whole-model inputs.

Reviewed by Cursor Bugbot for commit ceb63ca. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/how/breaking-changes.md Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2b1649c. Configure here.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

brock-acryl and others added 7 commits December 4, 2026 15:23
…elds

With `extract_report_field_usage`, a report page chart's `ChartInfo.inputs`
are now the semantic-model tables its visuals' resolved field references
belong to (first-seen order) instead of every table of the model; a page
whose references resolve to no table keeps the whole model, and the flag
off keeps today's output. A tile pinned from a report takes the union of
its report's pages' resolved tables, memoised per report id on the Mapper
and resolved counter-free, so the page pass alone feeds the
`report_field_references_*` counters as before; tiles pinned from a
dataset, or from a report without resolved field references, keep the
whole model.

Page charts now carry `chartUrl` (the report URL plus the page segment,
via `_page_url`) in every mode. This changes the flag-off goldens too:
each page chart gains a `chartUrl`, which is intended; narrowed page
`inputs` appear only in the workspace_apis field-usage goldens.

An untitled tile is named `Tile <n>` after its 1-based position on the
dashboard (`Constant.TILE_TITLE_FALLBACK`), applied to both `title` and
`description`, instead of an empty string.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…to match

A page or tile reference whose table exists but whose field is missing
from the fetched schema (a renamed column) still proves the chart reads
that table, so the table-level input is kept and only the field is
counted as unresolved. Also makes the tile position keyword-only and
separates the flag-gated input narrowing from the unconditional page URL
and untitled-tile fallback in the docs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…eport fallbacks

A page chart or report-backed tile only narrows its inputs when the
model was actually emitted, so a dataset dropped by
filter_dataset_endorsements can no longer leave charts pointing at
tables no MCP creates; a visual of such a page has no inputs either.
Page and tile narrowing now reads as "narrowed or whole model" without
the redundant flag checks, page field resolution is shared through
_resolve_page_fields, and pages that fall back to the whole model are
counted and surfaced as a warning. The unresolved counters are split
between unknown tables and missing fields of known tables.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…th modes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ale page fields

- Tile inputs from a report's pages are intersected with the tile's
  emitted model, so narrowing never names a table this run did not emit.
- A page whose field references match no schema field writes an empty
  InputFields so columns from an earlier run do not outlive the narrowed
  inputs.
- The whole-model fallback is only counted and warned when the model was
  emitted.
- Docs and the breaking-change entry describe the emitted-table rule,
  the silent fallback for unparsed definitions, input narrowing, and
  position-based tile names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d usage

A page missing from the report definition gets only the report-level
filter fields, and a definition with unparsed parts or filters drops some
fields, yet both narrowed ChartInfo.inputs to that subset and removed
edges to tables the page still reads. Pages now carry
field_usage_complete, set only for a page found in a fully parsed
definition; page and report-tile narrowing (and the fallback warning)
require it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ld usage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 22353dff Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ingestion PR or Issue related to the ingestion of metadata

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant